import fetch from 'common/src/utils/fetch'

// 查询毕业审核批次
export function findAllGraduateReviewBatch(data) {
    return fetch({
        url: '/api/graduationservice/graduateReviewBatch/findAllGraduateReviewBatch',
        method: 'post',
        data
    })
}
// 查询毕业生名单
export function findGraduateList(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/findGraduateList',
        method: 'post',
        data
    })
}

// 查询毕业结论不一致说明申请
export function findConclusionConformityAuditList(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/findConclusionConformityAuditList',
        method: 'post',
        data
    })
}
// 查询毕业结论不一致说明申请查看
export function findConclusionConformityApplyList(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/findConclusionConformityApplyList',
        method: 'post',
        data
    })
}
// 毕业结论不一致说明审核—通过
export function conclusionConformityAuditPass(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/conclusionConformityAuditPass',
        method: 'post',
        data
    })
}
// 毕业结论不一致说明审核—不通过
export function conclusionConformityAuditNoPass(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/conclusionConformityAuditNoPass',
        method: 'post',
        data
    })
}
// 保存审核结论
export function saveOrSubmitCollegeAudit(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/saveOrSubmitCollegeAudit',
        method: 'post',
        data
    })
}
// 设置机审
export function setMachine(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/setMachine',
        method: 'post',
        data
    })
}
// 毕业生名单—设置学位证书编号
export function editCertificateNo(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/editCertificateNo',
        method: 'post',
        data
    })
}
// 毕业生名单—设置辅修专业证书编号
export function editMinorCertificateNo(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/editMinorCertificateNo',
        method: 'post',
        data
    })
}
// 毕业生名单—退回审核结论
export function saveReturnReviewConclusion(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/saveReturnReviewConclusion',
        method: 'post',
        data
    })
}
//毕业生名单— 初始化毕业生名单
export function createGraduateList(data) {
    return fetch({
        url:
            '/api/graduationservice/graduateList/createGraduateList?grade=' +
            data.graduationDate +
            '&isOverseas=' +
            data.isOverseas,
        method: 'GET'
    })
}
//查询机审详情
export function getMachineDetail(studentID) {
    return fetch({
        url: `/api/graduationservice/graduateList/getMachineDetail?studentID=${studentID}`,
        method: 'get'
    })
}
// 毕业生名单—退回审核结论
export function selectCurrentBatch(data) {
    return fetch({
        url: '/api/graduationservice/graduateReviewAuth/selectCurrentBatch',
        method: 'post',
        data
    })
}
// 设置机审-RedisResul获取数据
export function getRedisResult(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/result/' + data,
        method: 'get',
        data
    })
}
// 毕业结论不一致说明申请—查询专业
export function findProfessionList(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/findProfessionList',
        method: 'post',
        data
    })
}
//设置机审
export function setMachineType(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/setMachineType',
        method: 'post',
        data
    })
}
//查看机审
export function findMachineType(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/findMachineType',
        method: 'post',
        data
    })
}

/**
 * 查询当前学生上一位、下一位的学生id
 * step 0:下一步；1：上一步
 * isOverseas 0:国内生；1留学生
 * currentStudentId :当前学生ID
 */
export function findPreviousOrNextStep(data){
    return fetch ({
        url:`/api/graduationservice/graduateList/findPreviousOrNextStep`,
        method: 'post',
        data
    })
}

// 名单页面打印 弹框打印pdf
export function printPdfInList(queryParam) {
    return fetch({
        url: '/api/graduationservice/graduateList/export?' + queryParam,
        method: 'get',
    })
}

// 名单页面打印 弹框打印pdf
export function findFaculty(params) {
    let authId = localStorage.getItem('activeAuthId');
    params = params || {};
    params.authId = authId || '';
    return fetch({
        url: '/api/graduationservice/graduateList/findFacultyWithGraduates',
        params
    })
}

//编辑不一致说明结论
export function editIConclusionDesc(data) {
    return fetch({
        url: '/api/graduationservice/graduateList/editIConclusionDesc',
        method: 'post',
        data
    })
}

export function saveRemark(params) {
    return fetch({
        url: '/api/graduationservice/graduateList/saveRemark',
        method: 'get',
        params
    })
}